function enabledUserDialog(
    {
        userId,
        userName,
        callback = Function()
    }
) {
    if (!userId) {
        return $.toast("用户ID不能为空");
    }

    const $dialogWidget = $.dialog(
        userName ? "是否确定启用用户(" + userName + ")" : "是否确定启用该用户",
        {
            title: "启用用户",
            width: "300px",
            ok() {
                enabledUser({
                    userId
                }, res => {
                    if (res.Code !== 10000) {
                        return $.toast(res.Message);
                    }

                    $dialogWidget.remove();
                    $.toast("启用成功");
                    callback();
                })
            }
        }
    )

    function enabledUser(param, callback = Function()) {
        return $.sApi({
            data: param,
            url: "/api/User/enabledUser",
        }, callback)
    }
}